package com.juphoon.quiz.controller;

import com.juphoon.quiz.base.bean.ResponseBean;
import com.juphoon.quiz.mapper.QuizMapper;
import com.juphoon.quiz.service.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Controller {


    @Autowired
    private QuizMapper quizMapper;
    @Autowired
    private AnswerService answerService;

    @RequestMapping("/test")
    public ResponseBean get() {
        answerService.getAll();
        return new ResponseBean(ResponseBean.SUCCESS, "", "");
    }

    @RequestMapping("/test1")
    public ResponseBean get1() {
        System.err.println("aaaaaaaaaaaaaaaaaaaaaaaa");
        answerService.postAnswer();
        return new ResponseBean(ResponseBean.SUCCESS, "", quizMapper.selectByPrimaryKey(1));
    }
}
